<?php

namespace App\Validate\api;

use Illuminate\Foundation\Http\FormRequest;
use App\Validate\BaseValidate;

class CharacterValidate extends BaseValidate
{

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'face_id'=>'required|integer',
            'hair_id'=>'required|integer',
            'expression_id'=>'required|integer',
            'cloth_id'=>'required|integer',
            'title'=>'required',
            'username'=>'required',
            'sex'=>'required',
            'state'=>'required',
            'img'=>'required',
            'cartoon_id'=>'required',
            'face_img'=>'required',
            'expression_img'=>'required',
            'after_hair_img'=>'required',
            'front_hair_img'=>'required',
            'cloth_img'=>'required',
        ];
    }

    public function messages()
    {
        return [
            //'title.required'=>'标题不能为空',
            'username.required'=>'角色姓名不能为空',
            'sex.required'=>'角色性别不能为空',
            'state.required'=>'角色阶段不能为空',
            'category.integer'=>'类型/标签必须为整数',
            'category.required'=>'类型/标签不能为空',
            'img.required'=>'预览图不能为空',
            'face_id.integer'=>'脸型ID必须为整数',
            'hair_id.integer'=>'发型ID必须为整数',
            'expression_id.integer'=>'表情ID必须为整数',
            'cloth_id.integer'=>'衣服ID必须为整数',
            'cartoon_id.required'=>'漫画cartoon_id不能为空',
            'id.integer'=>'角色ID必须为整数',
            'face_img.required'=>'脸型图片不能为空',
            'expression_img.required'=>'表情图片不能为空',
            'after_hair_img.required'=>'后发型图片不能为空',
            'front_hair_img.required'=>'前发型图片不能为空',
            'cloth_img.required'=>'衣服图片不能为空',

        ];
    }

    public $scenes = [
        'character'=>['username','sex','state','img','face_id','hair_id','expression_id','cloth_id','face_img','after_hair_img','front_hair_img','expression_img','cloth_img'],
        'source'=>['category'],
        'getCartoonRoleList'=>['cartoon_id'],
        'info'=>['id'],
        'edit'=>['id','img','face_id','hair_id','expression_id','cloth_id','face_img','after_hair_img','front_hair_img','expression_img','cloth_img']
    ];
}
